<template>
	<view class="box">
		<view class="topbox">
			<view class="inputbox">
				<image src="../../static/image/搜索.png" mode=""></image>
				<u-input v-model="value" :type="type" :border="border" />
			</view>
			<text @click="operation">{{flag?'管理':'全选'}}</text>
		</view>
		<view class="list" v-for="(item, index) in list" :key="index">
			<Baesorder></Baesorder>
			<u-checkbox-group @change="checkboxGroupChange" v-if="!flag">
				<u-checkbox shape="circle" active-color="#f84a38" @change="checkboxChange" v-model="item.checked"
					:name="item.name"></u-checkbox>
			</u-checkbox-group>
		</view>
		<view class="del" v-if="!flag">删除</view>
	</view>
</template>

<script>
	import Baesorder from "../../components/Baesorder/index.vue"
	export default {
		data() {
			return {
				value: '',
				type: 'text',
				border: false,
				list: [{
						name: 'apple',
						checked: false,
						disabled: false
					},
					{
						name: 'banner',
						checked: false,
						disabled: false
					},
					{
						name: 'orange',
						checked: false,
						disabled: false
					}
				],
				flag:true
			}
		},
		components: {
			Baesorder
		},
		methods: {
			checkboxGroupChange() {

			},
			checkboxChange() {

			},
			operation(){
				this.flag=!this.flag
			}
		}
	}
</script>

<style lang="scss" scoped>
	.box {
		background-color: #FFFFFF;
		padding-top: 30rpx;
		box-sizing: border-box;

		.topbox {
			display: flex;
			align-items: center;
			margin-left: 65rpx;

			.inputbox {
				width: 570rpx;
				height: 64rpx;
				border-radius: 32rpx;
				display: flex;
				align-items: center;
				border: solid 2rpx #f0f0f0;
				padding-left: 20rpx;
				box-sizing: border-box;

				image {
					width: 39rpx;
					height: 39rpx;
				}
			}

			text {
				font-family: SourceHanSansCN-Regular;
				font-size: 28rpx;
				color: #222222;
				margin-left: 20rpx;
			}
		}

		.list {
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 10rpx;
			box-sizing: border-box;
		}

		.del {
			margin-top: 20rpx;
			width: 160rpx;
			height: 58rpx;
			background-color: #f84b38;
			border-radius: 29rpx;
			line-height: 58rpx;
			text-align: center;
			margin-left: 550rpx;
			font-family: SourceHanSansCN-Regular;
			font-size: 24rpx;
			color: #ffffff;
		}
	}
</style>
